import pygame,random,math,datetime
              
def record_del(filename):
        name=str(filename)+".txt"
        with open(name,"w") as write_data:
                write_data.write("")
def record(filename,string):
        name=str(filename)+".txt"
        with open(name,"a") as write_data:
                write_data.writelines(str(string)+"\n")


class bug(object):
    """Generic bug handler"""
    def __init__(self,error_type="null"):
        ##will record to "error_null.txt" unless error_type is specified
        self.type=error_type
        self.now = datetime.datetime.now()
    def bug_record(self,message,urgency=0):
        filename="Error_"+str(self.type)
        record(filename,"["+str(urgency)+"] "+str(self.now.strftime("%d-%m-%Y AT %H:%M:%S \t \t"))+str(message))
        print "record successful:  recorded to\t",filename+".txt"


class entity(object):
    """defines mobile in-game entities"""
    pass


class gui(object):
    """basic game GUIs - menus in other words"""
    def __init__(self):
        pass
    def main_menu(self):
        pass
    def game_menu(self):
        pass
    def main_game(self):
        """renders the renderlists for in-game graphics"""
        pass
    ##call gui.game_menu() on top of anything rendered to get in-game interface
        ##I think......
        ##Cross that bridge when it comes to it.
    ##call sprite() for drawing of entities
    def pause_menu(self):
        """renders the self-evident pause-menu"""
        pass


class main(object):
    """the basic game engine"""
    ##I'll plot this out more once I get round to it. A lot of this region is on paper at the moment xD
    def active(self):
        """active-entity handler"""
        ##scans entity list for active things.
        pass


class sprite(object):
    """generic sprite handler"""
    def __init__(self):
        pass
    def draw(self):
        """draws a sprite with location, orientation, scale, etc etc"""
    ##this ONLY draw's sprites - I need to see exactly how pygame's rendering works - if its a "canvas" type gui then we'll need to
        ##draw everything from the bottom layer up at every frame, which will be processor-intensive. If it uses "active" drawing
        ##then the drawing of sprites can actually be handled by the entity() class OR by the sprite() class but only when 
        ##"draw_sprite" is set to TRUE (otherwise it will remove the sprite from the renderlist using another function)
        pass
        
